<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateDiscussesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('discusses', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('userid')->index('userid');
			$table->string('tag', 200)->default('');
			$table->string('content', 8192);
			$table->timestamps();
			$table->integer('delete')->default(0);
			$table->integer('vote')->default(0);
			$table->string('title', 200)->default('');
			$table->integer('ansnum')->default(0);
			$table->integer('rtime')->default(0);
			$table->integer('type')->default(0);
		});
        DB::update('ALTER TABLE discusses AUTO_INCREMENT = 207');
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('discusses');
	}

}
